set terminal cairolatex color size 4, 3 
set output '3d_lighting.tex'
unset border
unset key	#unset the title
#set style fill   solid 1.00 noborder # set style fill density = 1.00
set dummy u, v	#independent variables
set object  1 rect from screen 0, 0 to screen 1, 1
set object  1 behind lw 1.0  dashtype solid fc  rgb "gray"  fillstyle   solid 1.00 border lt -1 #set background color-filling
set parametric # from normal functions to parametric functions
set view 236, 339, 1.245, 1 #set the view angle: rot_x, rot_z, scale, scale_z
set isosamples 75, 75
unset xtics
unset ytics
unset ztics
set title "PM3D surfaces with specular highlighting" 
set urange [-pi,pi]
set vrange [-pi,pi]
set pm3d depthorder 
set pm3d lighting primary 0.5 specular 0.6
set palette rgbformulae 8, 9, 7
splot cos(u)+.5*cos(u)*cos(v),sin(u)+.5*sin(u)*cos(v),.5*sin(v) with pm3d,     1+cos(u)+.5*cos(u)*cos(v),.5*sin(v),sin(u)+.5*sin(u)*cos(v) with pm3d
